<form action="/galleryPhotos/update" method="POST" enctype="multipart/form-data" name="gallery">
<input type="hidden" name="userId" value="<?php echo $userId?>">
<table width="200" height="5" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="900" border="1" bordercolor="#FFCC99" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#Fffced"><table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30"><span class="tit">照片名称:</span>
          <input name="photo_name" type="text" class="text" />
        </td>
      </tr>
      <tr>
        <td  height="30" class="tit">所属景区/美食:
      		<?php if($type&&$id):?>
        	<input type="hidden" name="gallery_type" value="<?php echo $type?>">
        	<input type="hidden" name="gallery_type_id" value="<?php echo $id?>">
        	<input name="gallery_type_name" type="text" class="text" size="40" value="<?php echo $info->getName()?>" disabled />
        	<?php endif;?>
        </td>
      </tr>
      <tr>
        <td  height="30" class="tit">相册名称：
        	<?php $userInfo = getUserById($userId);?>
          	<input name="gallery_name" type="text" class="text" size="15" value="<?php echo $userInfo['username'];?>"/>
        </td>
      </tr>
      <tr>
        <td height="15" valign="middle"><span class="tit">照片说明：</span></td>
      </tr>
      <tr>
        <td height="15" align="center" valign="middle">
        	<textarea name="des" cols="80" rows="5" class="img"></textarea>
       	</td>
      </tr>
    </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="34%">
				<span class="titsmall">图片：</span><br />
				<div id="foodimg" style="margin-left:10px;">
					<div id="1">
						<input name="img[]" type="file" onchange="addimg(1)" />
					</div>
				</div>
          </td>
          <!-- <td width="21%" height="35"><table width="115" height="28" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td  style="background-image:url('img/anniu/anniu_r8_c7.png');width:115;height:28;" onmouseover="this.style.backgroundImage='url(img/anniu/anniu_r8_c28.png)'" onmouseout="this.style.backgroundImage='url(img/anniu/anniu_r8_c28.png)'">&nbsp;<span class="tit"> <a href="#">浏览</a></span></td>
                <td width="7"></td>
                <td  style="background-image:url('img/anniu/anniu_r8_c7.png');width:115;height:28;" onmouseover="this.style.backgroundImage='url(img/anniu/anniu_r8_c28.png)'" onmouseout="this.style.backgroundImage='url(img/anniu/anniu_r8_c28.png)'">&nbsp;<span class="tit"> 上传</span></td>
              </tr>
          </table></td> -->
          <td>&nbsp;</td>
        </tr>
      </table>
      <!-- <table width="749" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="img/dp/dianp_r9_c7.jpg" width="749" height="7" /></td>
        </tr>
      </table>
      <table width="749" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td background="img/dp/dianp_r10_c7.jpg"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><img src="img/group/index/index_r5_c2.jpg" width="130" height="85" class="img" /></td>
              <td><img src="img/group/index/index_r5_c2.jpg" width="130" height="85" class="img" /></td>
              <td><img src="img/group/index/index_r5_c2.jpg" width="130" height="85" class="img" /></td>
              <td><img src="img/group/index/index_r5_c2.jpg" width="130" height="85" class="img" /></td>
              <td><img src="img/group/index/index_r5_c2.jpg" width="130" height="85" class="img" /></td>
            </tr>
            <tr>
              <td height="25" align="center" class="word">删除</td>
              <td align="center" class="word">删除</td>
              <td align="center" class="word">删除</td>
              <td align="center" class="word">删除</td>
              <td align="center" class="word">删除</td>
            </tr>
          </table> </td>
        </tr>
      </table>-->
      <table width="749" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="img/dp/dianp_r17_c7.jpg" width="749" height="7" /></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr></tr>
        <tr>
          <td height="30" align="center"><table width="48" height="31" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td background="<?php echo SITE_URL?>img/anniu/anniu_r16_c8.png"><span class="login" onclick="$('form')[0].submit()"> 确定</span></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>
</body>
</html>
<script>
function addimg(id){
	var newId = id+1;
	var delStr = "&nbsp;<a href='javascript:delimg("+id+")'>删除</a>";
	var addStr = "<div id='"+newId+"'><input type='file' name='img[]' onchange='addimg("+newId+")'></div>";
	$('#'+id).append(delStr);
	$('#foodimg').append(addStr);
}
function delimg(id){
	$('#'+id).remove();
}
</script>
